package android.snake;

public class Board
{
	/* Init a board of size x*y.
	 * (Allocate the double arrray
	 * and set all cases to Empty)
	 */
	public Board(int x, int y) {
		Board_ = new Case[x][y];
		for (int i = 0; i < x; i++)
			for (int j = 0; j < y; j++)
			{
				if (i == 0 || j == 0 || i == x - 1 || j == y - 1)
					Board_[i][j] = Case.wall;
				else
					Board_[i][j] = Case.empty;
			}
		setX(x);
		setY(y);
	}
	
	private Case[][] Board_;
	private int X_;
	private int Y_;

	/* After this comment, getter and setter for
	 * all private fields.
	 */
	
	public void setBoard(Case[][] board) {
		Board_ = board;
	}

	public Case[][] getBoard() {
		return Board_;
	}

	public void setX(int x_) {
		this.X_ = x_;
	}

	public int getX() {
		return X_;
	}

	public void setY(int y_) {
		this.Y_ = y_;
	}

	public int getY() {
		return Y_;
	}
}
